/*
 * @Descripttion: 
 * @version: 
 * @Author: Jun
 * @Date: 2021-06-02 10:03:48
 * @LastEditors: Jun
 * @LastEditTime: 2021-06-02 14:30:29
 */
import {getStorage,setStorage,removeStorage} from "utils/localStorage.js"

export default {
    namespaced:true,//命名空间
    state:{
        userInfo: getStorage("zunyi_pc_userInfo")
    },
    mutations:{
        updateUserInfo(state,newUserInfo){//更新用户信息
            state.userInfo = newUserInfo
            setStorage("zunyi_pc_userInfo",state.userInfo)
        },
        removeUserInfo(state){//删除用户信息
            state.userInfo = null
            removeStorage("zunyi_pc_userInfo")
        }
    }
}
